/*
 * $Id: qtcQApplication.cpp 8 2010-11-08 18:49:48Z tfonrouge $
 */

#include "qtharbour.h"

#include <QApplication>

static int argc;
static char **argv;
static QApplication* pQApp = NULL;

HB_FUNC( QAPPLICATION_NEW )
{
    if(!pQApp)
    {
        xho_ObjParams objParams = xho_ObjParams( NULL );

        argc = hb_cmdargARGC();
        argv = hb_cmdargARGV();
        pQApp = new QApplication( argc, argv );

        objParams.Return( pQApp );
    }
}

HB_FUNC( QAPPLICATION_EXEC )
{
    hb_retni( qApp->exec() );
}
